home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 60.zip
/
BS1 part 60
/
Highspeed pascal.adf
/
Interface
/
Expansion.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-01-16
|
5KB
|
225 lines
Unit Expansion;
Interface
Uses AmigaDOS, Exec;
Type
pConfigDev = ^tConfigDev;
tCurrentBinding = Record
cb_ConfigDev: pConfigDev;
cb_FileName: pShortInt;
cb_ProductString: pShortInt;
cb_ToolTypes: ppShortInt;
End;
tExpansionBase = Record
LibNode: tLibrary;
Flags: ShortInt;
pad: ShortInt;
ExecBase: Pointer;
SegList: Pointer;
CurrentBinding: tCurrentBinding;
BoardList: tList;
MountList: tList;
AllocTable: Array [0..255] of ShortInt;
BindSemaphore: tSignalSemaphore;
Int2List: tInterrupt;
Int6List: tInterrupt;
Int7List: tInterrupt;
End;
tExpansionInt = Record
IntMask: Integer;
ArrayMax: Integer;
ArraySize: Integer;
End;
tExpansionRom = Record
er_Type: ShortInt;
er_Product: ShortInt;
er_Flags: ShortInt;
er_Reserved03: ShortInt;
er_Manufacturer: Integer;
er_SerialNumber: LongInt;
er_InitDiagVec: Integer;
er_Reserved0c: ShortInt;
er_Reserved0d: ShortInt;
er_Reserved0e: ShortInt;
er_Reserved0f: ShortInt;
End;
tDiagArea = Record
da_Config: ShortInt;
da_Flags: ShortInt;
da_Size: Integer;
da_DiagPoint: Integer;
da_BootPoint: Integer;
da_Name: Integer;
da_Reserved01: Integer;
da_Reserved02: Integer;
End;
tExpansionControl = Record
ec_Interrupt: ShortInt;
ec_Reserved11: ShortInt;
ec_BaseAddress: ShortInt;
ec_Shutup: ShortInt;
ec_Reserved14: ShortInt;
ec_Reserved15: ShortInt;
ec_Reserved16: ShortInt;
ec_Reserved17: ShortInt;
ec_Reserved18: ShortInt;
ec_Reserved19: ShortInt;
ec_Reserved1a: ShortInt;
ec_Reserved1b: ShortInt;
ec_Reserved1c: ShortInt;
ec_Reserved1d: ShortInt;
ec_Reserved1e: ShortInt;
ec_Reserved1f: ShortInt;
End;
tConfigDev = Record
cd_Node: tNode;
cd_Flags: ShortInt;
cd_Pad: ShortInt;
cd_Rom: tExpansionRom;
cd_BoardAddr: Pointer;
cd_BoardSize: Pointer;
cd_SlotAddr: Integer;
cd_SlotSize: Integer;
cd_Driver: Pointer;
cd_NextCD: pConfigDev;
cd_Unused: Array [0..3] of LongInt;
End;
pCurrentBinding = ^tCurrentBinding;
pExpansionBase = ^tExpansionBase;
pDeviceNode = ^tDeviceNode;
Var
ExpansionBase: pExpansionBase;
Const
ECIF_INTERRUPTING = $80;
DAC_BUSWIDTH = $C0;
ECIB_INTENA = $1;
DAC_NIBBLEWIDE = $0;
E_MEMORYBASE = $200000;
ERTB_CHAINEDCONFIG = $3;
ECIF_INTENA = $2;
ERT_NEWBOARD = $C0;
ERTF_CHAINEDCONFIG = $8;
ERFB_NOSHUTUP = $6;
ERFF_NOSHUTUP = $40;
ERTB_MEMLIST = $5;
DAC_CONFIGTIME = $10;
E_EXPANSIONBASE = $E80000;
ERTF_MEMLIST = $20;
ERTB_DIAGVALID = $4;
E_MEMORYSLOTS = $80;
ERTF_DIAGVALID = $10;
ECIB_INT2PEND = $4;
E_MEMORYSIZE = $800000;
ERT_TYPEMASK = $C0;
ERT_MEMMASK = $7;
ECIB_INT6PEND = $5;
ECIF_INT2PEND = $10;
ECIB_INT7PEND = $6;
ECIF_INT6PEND = $20;
E_EXPANSIONSLOTS = $8;
ECIB_RESET = $3;
ECIF_INT7PEND = $40;
ECIF_RESET = $8;
ERT_TYPESIZE = $2;
E_SLOTSHIFT = $10;
ERT_MEMSIZE = $3;
ERFB_MEMSPACE = $7;
E_EXPANSIONSIZE = $80000;
ERFF_MEMSPACE = $80;
ERT_TYPEBIT = $6;
ADNB_STARTPROC = $0;
ERT_MEMBIT = $0;
ADNF_STARTPROC = $1;
CDB_CONFIGME = $1;
EXPANSIONNAME = 'expansion.library';
DAC_NEVER = $0;
DAC_BINDTIME = $20;
CDF_CONFIGME = $2;
CDB_SHUTUP = $0;
E_SLOTMASK = $FFFF;
CDF_SHUTUP = $1;
TOTALSLOTS = $100;
DAC_BYTEWIDE = $40;
E_SLOTSIZE = $10000;
ECIB_INTERRUPTING = $7;
DAC_BOOTTIME = $30;
DAC_WORDWIDE = $80;
Procedure AddConfigDev (configDev: pConfigDev);
Procedure AllocBoardMem (slotSpec: LongInt);
Function AllocConfigDev: pConfigDev;
Function AllocExpansionMem
(numSlots: LongInt;
SlotAlign: LongInt): Pointer;
Procedure ConfigBoard
(board: Pointer;
configDev: pConfigDev);
Procedure ConfigChain (baseAddr: Pointer);
Function FindConfigDev
(oldConfigDev: pConfigDev;
manufacturer: LongInt;
product: LongInt): pConfigDev;
Procedure FreeBoardMem
(startSlot: LongInt;
slotSpec: LongInt);
Procedure FreeConfigDev (configDev: pConfigDev);
Procedure FreeExpansionMem
(startSlot: LongInt;
numSlots: LongInt);
Function ReadExpansionByte
(board: Pointer;
offset: LongInt): ShortInt;
Procedure ReadExpansionRom
(board: Pointer;
configDev: pConfigDev);
Procedure RemConfigDev (configDev: pConfigDev);
Procedure WriteExpansionByte
(board: Pointer;
offset: LongInt;
byte: LongInt);
Procedure ObtainConfigBinding;
Procedure ReleaseConfigBinding;
Procedure SetCurrentBinding
(currentBinding: pCurrentBinding;
bindingSize: LongInt);
Function GetCurrentBinding
(currentBinding: pCurrentBinding;
bindingSize: LongInt): LongInt;
Function MakeDosNode (parmPacket: Pointer): pDeviceNode;
Function AddDosNode
(bootPri: ShortInt;
flags: LongInt;
dosNode: pDeviceNode): Boolean;
Function ERT_MEMNEEDED (t: ShortInt): LongInt;
Function ERT_SLOTSNEEDED (t: ShortInt): ShortInt;
Function EC_MEMADDR (slot: Integer): APTR;
End.